package offer;

import java.util.Arrays;

public class offer_0061 {
    public boolean isStraight(int[] nums) {
        Arrays.sort(nums);
        int zero=0;
        int index=0;
        while(nums[index]==0){
            index++;
            zero++;
        }
        for(int i=index;i<4;++i){
            if(nums[i]==nums[i+1]) return false;
            if(nums[i]+1!=nums[i+1]){
                zero-=nums[i+1]-nums[i]-1;
            }
        }
        if(zero<0) return false;
        return true;
    }
}
